// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 创建摄像头 POST /api/cameras */
export async function createCamera(body: API.CameraCreateDto, options?: { [key: string]: any }) {
  return request<API.MessageDtoComposeCameraResponseDto>('/api/cameras', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获得用户 GET /api/cameras/${param0} */
export async function getCameraById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCameraByIdParams,
  options?: { [key: string]: any },
) {
  const { camera_id: param0, ...queryParams } = params;
  return request<API.MessageDtoComposeCameraResponseDto>(`/api/cameras/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新摄像头信息 role 支持 [ ROLE_GUEST , ROLE_ADMIN ]。<br/>这接口不支持修改密码。 PUT /api/cameras/${param0} */
export async function updateCameraDetails(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.updateCameraDetailsParams,
  body: API.CameraUpdateDetailsDto,
  options?: { [key: string]: any },
) {
  const { camera_id: param0, ...queryParams } = params;
  return request<API.MessageDtoComposeCameraResponseDto>(`/api/cameras/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 修改摄像头状态 PATCH /api/cameras/${param0}/status */
export async function updateCameraStatus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.updateCameraStatusParams,
  body: API.CameraUpdateStatusDto,
  options?: { [key: string]: any },
) {
  const { camera_id: param0, ...queryParams } = params;
  return request<API.MessageDtoComposeCameraResponseDto>(`/api/cameras/${param0}/status`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 获得摄像头列表 GET /api/cameras/page/${param0}/page_size/${param1} */
export async function getCameras(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCamerasParams,
  options?: { [key: string]: any },
) {
  const { page: param0, page_size: param1, ...queryParams } = params;
  return request<API.MessageDtoComposePageOfCameras>(
    `/api/cameras/page/${param0}/page_size/${param1}`,
    {
      method: 'GET',
      params: {
        ...queryParams,
      },
      ...(options || {}),
    },
  );
}
